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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.y: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.y: B = None
        self.p: E = None
        self.txt = txt

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

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