class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: D = None
        self.s: D = None
        self.r: A = None
        self.txt = txt

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

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

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

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

e.p = c
e.y = c
e.s = c
e.r = b
l.x = c
l.r = h
l.s = i
l.p = a
i.u = c
i.x = m
i.v = h
i.r = h
c.x = e
a.x = c
a.r = d
a.s = i
a.p = l
b.p = c
b.y = c
b.s = c
b.r = e
m.u = c
m.x = d
m.r = d
m.v = h
h.u = c
h.x = i
h.v = d
h.r = m
d.u = c
d.x = i
d.v = h
d.r = h
j.x = c
j.r = d
j.s = m
j.p = a
assert d.u.x.p.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: D = None
        self.s: D = None
        self.r: A = None
        self.txt = txt

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

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

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

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

e.p = c
e.y = c
e.s = c
e.r = b
l.x = c
l.r = h
l.s = i
l.p = a
i.u = c
i.x = m
i.v = h
i.r = h
c.x = e
a.x = c
a.r = d
a.s = i
a.p = l
b.p = c
b.y = c
b.s = c
b.r = e
m.u = c
m.x = d
m.r = d
m.v = h
h.u = c
h.x = i
h.v = d
h.r = m
d.u = c
d.x = i
d.v = h
d.r = h
j.x = c
j.r = d
j.s = m
j.p = a
assert d.u.x.p.x.r.txt == "b"