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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: F = None
        self.t: C = None
        self.r: F = None
        self.w: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: E = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: E = None
        self.y: E = None
        self.u: B = None
        self.txt = txt

b = A("b")
i = B("i")
k = C("k")
h = D("h")
a = E("a")
c = F("c")
d = F("d")
e = C("e")
m = A("m")

b.q = a
b.t = a
b.x = m
i.o = h
k.p = m
k.v = c
k.t = e
k.w = e
k.r = d
h.p = a
h.w = a
h.o = k
a.o = i
a.z = b
c.o = h
c.w = a
c.y = a
c.u = i
d.o = h
d.w = a
d.y = a
d.u = i
e.p = b
e.v = c
e.t = k
e.w = k
e.r = d
m.q = a
m.t = a
m.x = b
assert b.x.q.z.t.z.q.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: A = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: F = None
        self.t: C = None
        self.r: F = None
        self.w: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: E = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: E = None
        self.y: E = None
        self.u: B = None
        self.txt = txt

b = A("b")
i = B("i")
k = C("k")
h = D("h")
a = E("a")
c = F("c")
d = F("d")
e = C("e")
m = A("m")

b.q = a
b.t = a
b.x = m
i.o = h
k.p = m
k.v = c
k.t = e
k.w = e
k.r = d
h.p = a
h.w = a
h.o = k
a.o = i
a.z = b
c.o = h
c.w = a
c.y = a
c.u = i
d.o = h
d.w = a
d.y = a
d.u = i
e.p = b
e.v = c
e.t = k
e.w = k
e.r = d
m.q = a
m.t = a
m.x = b
assert b.x.q.z.t.z.q.o.o.txt == "h"