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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

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

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

c = A("c")
i = B("i")
h = C("h")
l = D("l")
g = E("g")
e = B("e")

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

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

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

c = A("c")
i = B("i")
h = C("h")
l = D("l")
g = E("g")
e = B("e")

c.s = e
c.u = e
c.x = l
c.p = l
i.s = l
h.o = g
h.u = c
h.t = c
l.v = h
l.o = h
l.s = h
g.q = h
g.y = h
e.s = l
assert i.s.o.o.y.txt == "h"