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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: F = None
        self.z: A = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: E = None
        self.x: F = None
        self.o: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: C = None
        self.w: D = None
        self.t: B = None
        self.txt = txt

g = A("g")
j = B("j")
m = C("m")
h = D("h")
e = E("e")
l = F("l")
n = A("n")
i = A("i")
a = F("a")
f = B("f")

g.q = i
g.t = i
g.u = e
j.v = l
j.t = l
j.z = i
j.q = e
m.p = e
m.s = e
m.x = a
m.o = a
h.z = i
h.t = m
e.q = h
e.t = f
e.o = g
l.u = i
l.r = m
l.w = h
l.t = f
n.q = g
n.t = g
n.u = e
i.q = g
i.t = n
i.u = e
a.u = n
a.r = m
a.w = h
a.t = f
f.v = a
f.t = l
f.z = g
f.q = e
assert g.t.t.t.u.o.u.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: A = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: F = None
        self.z: A = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: E = None
        self.x: F = None
        self.o: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: C = None
        self.w: D = None
        self.t: B = None
        self.txt = txt

g = A("g")
j = B("j")
m = C("m")
h = D("h")
e = E("e")
l = F("l")
n = A("n")
i = A("i")
a = F("a")
f = B("f")

g.q = i
g.t = i
g.u = e
j.v = l
j.t = l
j.z = i
j.q = e
m.p = e
m.s = e
m.x = a
m.o = a
h.z = i
h.t = m
e.q = h
e.t = f
e.o = g
l.u = i
l.r = m
l.w = h
l.t = f
n.q = g
n.t = g
n.u = e
i.q = g
i.t = n
i.u = e
a.u = n
a.r = m
a.w = h
a.t = f
f.v = a
f.t = l
f.z = g
f.q = e
assert g.t.t.t.u.o.u.o.u.txt == "e"