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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: D = None
        self.v: E = None
        self.w: D = None
        self.s: F = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: D = None
        self.v: E = None
        self.w: D = None
        self.s: F = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

f.v = c
f.z = j
c.x = f
c.y = j
c.w = j
c.v = n
c.s = a
c.z = m
m.s = f
m.o = j
m.r = c
j.y = a
j.q = c
i.p = n
l.z = a
l.r = a
l.w = c
l.s = j
l.y = f
n.p = i
a.z = l
a.r = l
a.w = c
a.s = j
a.y = f
assert f.v.v.p.p.p.p.txt == "n"