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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: D = None
        self.t: D = None
        self.x: C = None
        self.txt = txt

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

c = A("c")
e = B("e")
l = C("l")
h = D("h")
f = C("f")
b = C("b")
j = A("j")
g = C("g")

c.z = l
c.w = e
c.p = g
c.t = h
e.z = l
l.y = c
l.r = h
l.t = h
l.x = b
h.s = g
h.u = c
h.w = e
f.y = j
f.r = h
f.t = h
f.x = l
b.y = c
b.r = h
b.t = h
b.x = f
j.z = g
j.w = e
j.p = l
j.t = h
g.y = c
g.r = h
g.t = h
g.x = b
assert g.y.p.x.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: B = None
        self.p: C = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: D = None
        self.t: D = None
        self.x: C = None
        self.txt = txt

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

c = A("c")
e = B("e")
l = C("l")
h = D("h")
f = C("f")
b = C("b")
j = A("j")
g = C("g")

c.z = l
c.w = e
c.p = g
c.t = h
e.z = l
l.y = c
l.r = h
l.t = h
l.x = b
h.s = g
h.u = c
h.w = e
f.y = j
f.r = h
f.t = h
f.x = l
b.y = c
b.r = h
b.t = h
b.x = f
j.z = g
j.w = e
j.p = l
j.t = h
g.y = c
g.r = h
g.t = h
g.x = b
assert g.y.p.x.y.t.txt == "h"