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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: D = None
        self.r: A = None
        self.y: E = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: B = None
        self.txt = txt

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

k = A("k")
l = B("l")
j = C("j")
a = D("a")
f = E("f")
n = F("n")
c = E("c")
d = A("d")

k.z = l
l.p = f
j.t = n
j.o = a
j.r = d
j.p = d
j.y = f
a.w = c
a.p = k
f.z = a
f.u = l
n.o = a
c.z = a
c.u = l
d.z = l
assert n.o.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: D = None
        self.r: A = None
        self.y: E = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: B = None
        self.txt = txt

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

k = A("k")
l = B("l")
j = C("j")
a = D("a")
f = E("f")
n = F("n")
c = E("c")
d = A("d")

k.z = l
l.p = f
j.t = n
j.o = a
j.r = d
j.p = d
j.y = f
a.w = c
a.p = k
f.z = a
f.u = l
n.o = a
c.z = a
c.u = l
d.z = l
assert n.o.p.z.txt == "l"