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

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

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

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

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

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

h = A("h")
f = B("f")
c = C("c")
e = D("e")
b = E("b")
n = F("n")
d = E("d")

h.p = n
h.z = c
h.y = f
f.t = c
f.s = e
c.u = b
e.p = n
b.s = f
b.y = f
b.q = h
n.x = e
n.v = c
n.z = c
n.u = f
n.y = f
n.r = d
d.s = f
d.y = f
d.q = h
assert c.u.s.s.p.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: C = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

h = A("h")
f = B("f")
c = C("c")
e = D("e")
b = E("b")
n = F("n")
d = E("d")

h.p = n
h.z = c
h.y = f
f.t = c
f.s = e
c.u = b
e.p = n
b.s = f
b.y = f
b.q = h
n.x = e
n.v = c
n.z = c
n.u = f
n.y = f
n.r = d
d.s = f
d.y = f
d.q = h
assert c.u.s.s.p.u.s.txt == "e"