class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: D = None
        self.x: B = None
        self.t: B = None
        self.v: D = None
        self.txt = txt

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

i.r = h
k.w = f
k.u = i
l.t = h
l.o = d
d.o = f
c.r = l
c.y = d
c.v = d
c.x = k
c.t = k
n.t = h
n.o = d
f.w = k
f.u = i
h.r = n
h.y = d
h.v = d
h.x = k
h.t = f
assert c.v.o.u.r.r.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: D = None
        self.x: B = None
        self.t: B = None
        self.v: D = None
        self.txt = txt

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

i.r = h
k.w = f
k.u = i
l.t = h
l.o = d
d.o = f
c.r = l
c.y = d
c.v = d
c.x = k
c.t = k
n.t = h
n.o = d
f.w = k
f.u = i
h.r = n
h.y = d
h.v = d
h.x = k
h.t = f
assert c.v.o.u.r.r.t.t.txt == "f"