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

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

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

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

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

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

i.u = c
i.s = c
i.o = c
e.o = c
j.u = i
j.x = c
j.o = h
j.r = h
c.o = j
c.r = e
h.u = c
h.s = c
h.o = c
h.v = j
assert c.o.r.u.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

i.u = c
i.s = c
i.o = c
e.o = c
j.u = i
j.x = c
j.o = h
j.r = h
c.o = j
c.r = e
h.u = c
h.s = c
h.o = c
h.v = j
assert c.o.r.u.r.o.txt == "c"