class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: B = None
        self.y: B = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: A = None
        self.y: A = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: C = None
        self.q: C = None
        self.txt = txt

e = A("e")
h = B("h")
d = C("d")
a = D("a")
c = A("c")
l = B("l")

e.o = c
e.x = h
e.y = h
e.t = h
h.s = l
h.u = l
h.q = c
d.x = l
d.o = l
d.q = c
d.y = c
a.o = l
a.y = d
a.q = d
c.o = e
c.x = l
c.y = l
c.t = l
l.s = h
l.u = h
l.q = e
assert c.o.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: B = None
        self.y: B = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: A = None
        self.y: A = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: C = None
        self.q: C = None
        self.txt = txt

e = A("e")
h = B("h")
d = C("d")
a = D("a")
c = A("c")
l = B("l")

e.o = c
e.x = h
e.y = h
e.t = h
h.s = l
h.u = l
h.q = c
d.x = l
d.o = l
d.q = c
d.y = c
a.o = l
a.y = d
a.q = d
c.o = e
c.x = l
c.y = l
c.t = l
l.s = h
l.u = h
l.q = e
assert c.o.y.u.txt == "l"