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

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

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

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

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

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

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

i.u = e
i.s = m
e.t = n
b.x = k
b.s = n
f.u = a
f.w = n
f.z = j
f.s = i
f.x = i
a.u = n
m.w = e
m.t = b
j.u = n
n.w = e
n.t = k
k.x = b
k.s = m
assert e.t.w.t.w.t.w.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

i.u = e
i.s = m
e.t = n
b.x = k
b.s = n
f.u = a
f.w = n
f.z = j
f.s = i
f.x = i
a.u = n
m.w = e
m.t = b
j.u = n
n.w = e
n.t = k
k.x = b
k.s = m
assert e.t.w.t.w.t.w.t.w.txt == "e"