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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: D = None
        self.txt = txt

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

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

e.x = j
a.s = n
a.r = f
f.x = j
f.o = k
f.t = m
l.z = f
l.t = f
h.y = j
h.s = l
j.u = e
j.o = f
m.s = h
m.r = f
k.z = f
k.t = f
n.y = j
n.s = l
assert e.x.u.x.u.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: D = None
        self.txt = txt

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

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

e.x = j
a.s = n
a.r = f
f.x = j
f.o = k
f.t = m
l.z = f
l.t = f
h.y = j
h.s = l
j.u = e
j.o = f
m.s = h
m.r = f
k.z = f
k.t = f
n.y = j
n.s = l
assert e.x.u.x.u.x.o.txt == "f"