#include<bits/stdc++.h>

using namespace std;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n,k;
  cin >> n >> k;
  vector<int> t(k),u(k);
  for(auto &nx : t){cin >> nx;}
  for(auto &nx : u){cin >> nx;}
  for(int i=0;i<n;i++){
    int b,m,e;
    if(i%2){b=2;m=1;e=1;}
    else{b=1;m=1;e=1;}
    cout << b << " " << m << " " << e << "\n";
  }
  return 0;
}