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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = 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.y: A = None
        self.s: C = None
        self.v: D = None
        self.o: D = None
        self.u: D = None
        self.z: D = None
        self.txt = txt

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

f.v = a
f.r = m
f.t = j
a.s = f
j.t = m
j.y = d
j.o = b
j.s = b
j.z = a
d.z = n
n.p = d
m.y = f
m.s = j
m.v = d
m.o = d
m.u = d
m.z = d
l.t = m
l.y = d
l.o = b
l.s = b
l.z = a
b.y = f
b.s = l
b.v = d
b.o = d
b.u = d
b.z = d
assert d.z.p.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: F = None
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = 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.y: A = None
        self.s: C = None
        self.v: D = None
        self.o: D = None
        self.u: D = None
        self.z: D = None
        self.txt = txt

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

f.v = a
f.r = m
f.t = j
a.s = f
j.t = m
j.y = d
j.o = b
j.s = b
j.z = a
d.z = n
n.p = d
m.y = f
m.s = j
m.v = d
m.o = d
m.u = d
m.z = d
l.t = m
l.y = d
l.o = b
l.s = b
l.z = a
b.y = f
b.s = l
b.v = d
b.o = d
b.u = d
b.z = d
assert d.z.p.z.p.txt == "d"