class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

l.y = e
h.o = i
m.x = i
m.t = f
m.u = k
b.s = l
b.u = g
b.z = f
b.w = i
k.t = j
g.w = b
g.x = i
j.t = k
i.o = h
e.s = l
e.u = g
e.z = m
e.w = h
f.x = i
f.t = m
f.u = k
assert f.t.x.o.o.o.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

l.y = e
h.o = i
m.x = i
m.t = f
m.u = k
b.s = l
b.u = g
b.z = f
b.w = i
k.t = j
g.w = b
g.x = i
j.t = k
i.o = h
e.s = l
e.u = g
e.z = m
e.w = h
f.x = i
f.t = m
f.u = k
assert f.t.x.o.o.o.o.o.o.o.txt == "h"