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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.x: F = None
        self.u: C = None
        self.z: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.x: F = None
        self.u: C = None
        self.z: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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