class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: B = None
        self.t: C = None
        self.w: C = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: B = None
        self.v: F = None
        self.z: B = None
        self.q: E = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: A = None
        self.u: D = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = None
        self.txt = txt

m = A("m")
j = B("j")
a = C("a")
d = D("d")
h = E("h")
f = F("f")
g = E("g")
e = A("e")
c = B("c")

m.o = e
m.z = c
m.u = c
m.t = a
m.w = a
j.w = f
j.v = f
j.o = c
j.z = c
j.q = h
j.x = a
a.o = e
d.r = g
d.q = e
h.r = g
h.q = m
h.u = d
h.o = d
f.w = a
f.z = j
g.r = h
g.q = m
g.u = d
g.o = d
e.o = m
e.z = c
e.u = c
e.t = a
e.w = a
c.w = f
c.v = f
c.o = j
c.z = j
c.q = h
c.x = a
assert g.q.t.o.u.q.u.q.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: B = None
        self.t: C = None
        self.w: C = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: B = None
        self.v: F = None
        self.z: B = None
        self.q: E = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: A = None
        self.u: D = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = None
        self.txt = txt

m = A("m")
j = B("j")
a = C("a")
d = D("d")
h = E("h")
f = F("f")
g = E("g")
e = A("e")
c = B("c")

m.o = e
m.z = c
m.u = c
m.t = a
m.w = a
j.w = f
j.v = f
j.o = c
j.z = c
j.q = h
j.x = a
a.o = e
d.r = g
d.q = e
h.r = g
h.q = m
h.u = d
h.o = d
f.w = a
f.z = j
g.r = h
g.q = m
g.u = d
g.o = d
e.o = m
e.z = c
e.u = c
e.t = a
e.w = a
c.w = f
c.v = f
c.o = j
c.z = j
c.q = h
c.x = a
assert g.q.t.o.u.q.u.q.u.q.txt == "h"