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

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

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

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

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

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

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

m.v = j
m.x = j
n.p = i
n.s = i
n.o = i
n.z = a
n.t = l
j.r = n
j.w = k
l.x = n
l.y = n
l.p = n
i.p = a
k.p = n
a.p = n
assert a.p.z.p.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

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

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