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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: F = None
        self.p: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: F = None
        self.p: A = None
        self.t: A = None
        self.txt = txt

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

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

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