#include #include using namespace std; int main(){ int a[4][4]; int x, y; for(int i = 0; i < 4; i++){ for(int j = 0; j < 4; j++){ cin >> a[i][j]; if(a[i][j] == 0) { x = i; y = j; } } } unordered_map mp; for(int i = 0; i < 4; i++){ mp[a[x][i]] = 1; } for(int i = 0; i < 5; i++){ if(mp.count(i) == 0) { cout << i << endl; return 0; } } return 0; }