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

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

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

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

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

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

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

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

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

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

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

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

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