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

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: B = None
        self.p: A = None
        self.q: E = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

h = A("h")
n = B("n")
j = C("j")
a = D("a")
i = E("i")
l = D("l")
d = B("d")
m = A("m")

h.o = l
n.v = d
n.w = d
n.p = m
n.q = i
n.x = h
j.p = l
a.x = h
i.r = j
i.u = d
l.x = h
d.v = n
d.w = n
d.p = m
d.q = i
d.x = h
m.o = a
assert i.r.p.x.o.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: B = None
        self.p: A = None
        self.q: E = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

h = A("h")
n = B("n")
j = C("j")
a = D("a")
i = E("i")
l = D("l")
d = B("d")
m = A("m")

h.o = l
n.v = d
n.w = d
n.p = m
n.q = i
n.x = h
j.p = l
a.x = h
i.r = j
i.u = d
l.x = h
d.v = n
d.w = n
d.p = m
d.q = i
d.x = h
m.o = a
assert i.r.p.x.o.x.o.txt == "l"