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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: E = None
        self.p: C = None
        self.u: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: E = None
        self.p: C = None
        self.u: C = None
        self.t: C = None
        self.txt = txt

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

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

c.p = i
c.r = a
n.y = c
a.x = n
b.v = m
b.o = j
b.r = n
b.z = a
b.x = a
b.s = a
m.o = b
m.r = i
m.p = a
m.u = a
m.t = a
j.z = b
j.y = n
i.o = b
i.r = m
i.p = a
i.u = a
i.t = a
assert n.y.p.o.r.y.r.x.txt == "n"