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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.w: E = None
        self.r: A = None
        self.o: F = None
        self.txt = txt

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

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

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

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

c = A("c")
n = B("n")
l = C("l")
d = D("d")
j = E("j")
m = F("m")

c.z = l
c.t = j
c.p = n
n.u = j
n.s = j
n.w = j
n.r = c
n.o = m
l.t = j
d.z = l
d.t = l
d.s = m
d.p = m
j.x = n
j.q = l
m.s = d
m.z = l
assert c.p.r.p.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: E = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.w: E = None
        self.r: A = None
        self.o: F = None
        self.txt = txt

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

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

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

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

c = A("c")
n = B("n")
l = C("l")
d = D("d")
j = E("j")
m = F("m")

c.z = l
c.t = j
c.p = n
n.u = j
n.s = j
n.w = j
n.r = c
n.o = m
l.t = j
d.z = l
d.t = l
d.s = m
d.p = m
j.x = n
j.q = l
m.s = d
m.z = l
assert c.p.r.p.o.s.txt == "d"