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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: F = None
        self.y: D = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: F = None
        self.y: D = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: A = None
        self.txt = txt

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

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

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

f.z = i
f.q = l
n.t = l
n.q = f
n.u = c
e.w = l
e.y = l
e.o = i
e.z = n
l.v = e
l.r = f
c.x = f
i.w = e
i.z = e
i.u = e
i.v = n
i.t = l
i.o = l
j.x = f
d.z = i
d.q = l
assert n.q.z.z.z.t.txt == "l"