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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: D = None
        self.r: E = None
        self.z: D = None
        self.txt = txt

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

k.q = d
a.o = i
j.t = n
n.t = e
n.o = a
n.w = a
e.x = n
e.r = n
d.u = j
d.y = n
d.z = n
d.r = e
i.t = n
assert i.t.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: D = None
        self.r: E = None
        self.z: D = None
        self.txt = txt

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

k.q = d
a.o = i
j.t = n
n.t = e
n.o = a
n.w = a
e.x = n
e.r = n
d.u = j
d.y = n
d.z = n
d.r = e
i.t = n
assert i.t.w.o.txt == "i"