class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: E = None
        self.q: A = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: C = None
        self.u: C = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: E = None
        self.txt = txt

n = A("n")
j = B("j")
k = C("k")
f = D("f")
h = E("h")
i = F("i")
d = E("d")
l = A("l")

n.t = h
n.w = h
n.q = l
n.y = f
j.x = f
j.s = k
j.u = k
j.q = k
k.q = j
k.v = h
k.r = d
f.q = j
f.t = k
h.q = l
h.y = k
i.u = l
i.y = d
d.q = l
d.y = k
l.t = d
l.w = d
l.q = n
l.y = f
assert i.y.y.r.y.r.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: E = None
        self.q: A = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: C = None
        self.u: C = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: E = None
        self.txt = txt

n = A("n")
j = B("j")
k = C("k")
f = D("f")
h = E("h")
i = F("i")
d = E("d")
l = A("l")

n.t = h
n.w = h
n.q = l
n.y = f
j.x = f
j.s = k
j.u = k
j.q = k
k.q = j
k.v = h
k.r = d
f.q = j
f.t = k
h.q = l
h.y = k
i.u = l
i.y = d
d.q = l
d.y = k
l.t = d
l.w = d
l.q = n
l.y = f
assert i.y.y.r.y.r.q.q.txt == "n"