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

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

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

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

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

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

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

b.u = f
b.y = c
h.q = c
h.t = g
c.t = g
d.o = g
d.t = g
d.p = i
d.w = l
d.y = m
d.s = f
l.p = c
f.s = i
f.u = b
f.z = l
f.x = l
k.u = i
k.y = c
g.q = c
g.t = h
m.o = h
m.t = g
m.p = i
m.s = i
m.w = l
m.y = d
i.s = f
i.u = k
i.z = l
i.x = l
assert g.t.q.t.q.t.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

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

b.u = f
b.y = c
h.q = c
h.t = g
c.t = g
d.o = g
d.t = g
d.p = i
d.w = l
d.y = m
d.s = f
l.p = c
f.s = i
f.u = b
f.z = l
f.x = l
k.u = i
k.y = c
g.q = c
g.t = h
m.o = h
m.t = g
m.p = i
m.s = i
m.w = l
m.y = d
i.s = f
i.u = k
i.z = l
i.x = l
assert g.t.q.t.q.t.t.q.txt == "c"