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

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

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

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

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

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

l.y = h
g.v = j
c.o = n
c.r = d
n.q = c
n.t = h
n.u = l
i.y = l
i.x = n
d.y = h
b.v = g
h.o = n
h.r = d
j.v = b
f.y = d
f.x = n
assert h.o.t.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

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

l.y = h
g.v = j
c.o = n
c.r = d
n.q = c
n.t = h
n.u = l
i.y = l
i.x = n
d.y = h
b.v = g
h.o = n
h.r = d
j.v = b
f.y = d
f.x = n
assert h.o.t.r.y.txt == "h"