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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: C = None
        self.x: A = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: A = None
        self.v: B = None
        self.txt = txt

e = A("e")
f = B("f")
m = C("m")
l = D("l")
c = D("c")
j = C("j")
i = A("i")
d = D("d")
h = B("h")

e.p = j
e.z = i
e.u = i
f.y = c
f.z = m
f.x = e
f.s = d
m.x = d
m.p = j
m.w = j
m.u = c
l.u = c
l.x = e
l.v = f
c.u = l
c.x = e
c.v = h
j.x = d
j.p = m
j.w = m
j.u = l
i.p = j
i.z = e
i.u = e
d.u = c
d.x = i
d.v = h
h.y = l
h.s = l
h.z = j
h.x = e
assert c.x.u.p.x.v.y.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: A = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: C = None
        self.x: A = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: A = None
        self.v: B = None
        self.txt = txt

e = A("e")
f = B("f")
m = C("m")
l = D("l")
c = D("c")
j = C("j")
i = A("i")
d = D("d")
h = B("h")

e.p = j
e.z = i
e.u = i
f.y = c
f.z = m
f.x = e
f.s = d
m.x = d
m.p = j
m.w = j
m.u = c
l.u = c
l.x = e
l.v = f
c.u = l
c.x = e
c.v = h
j.x = d
j.p = m
j.w = m
j.u = l
i.p = j
i.z = e
i.u = e
d.u = c
d.x = i
d.v = h
h.y = l
h.s = l
h.z = j
h.x = e
assert c.x.u.p.x.v.y.x.u.txt == "i"