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

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

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

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

b = A("b")
c = B("c")
a = C("a")
l = D("l")
f = D("f")
h = B("h")
n = B("n")
e = A("e")

b.y = e
b.u = e
b.s = a
b.p = a
c.o = b
c.z = a
c.s = l
a.u = f
a.x = c
a.t = n
l.z = a
l.s = b
l.p = f
f.z = a
f.s = e
f.p = l
h.o = b
h.z = a
h.s = f
n.o = e
n.z = a
n.s = l
e.y = b
e.u = b
e.s = a
e.p = a
assert a.u.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: C = None
        self.u: A = None
        self.p: C = None
        self.txt = txt

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

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

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

b = A("b")
c = B("c")
a = C("a")
l = D("l")
f = D("f")
h = B("h")
n = B("n")
e = A("e")

b.y = e
b.u = e
b.s = a
b.p = a
c.o = b
c.z = a
c.s = l
a.u = f
a.x = c
a.t = n
l.z = a
l.s = b
l.p = f
f.z = a
f.s = e
f.p = l
h.o = b
h.z = a
h.s = f
n.o = e
n.z = a
n.s = l
e.y = b
e.u = b
e.s = a
e.p = a
assert a.u.p.s.txt == "b"