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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: B = None
        self.w: D = None
        self.v: D = None
        self.txt = txt

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

e.v = h
e.q = l
e.t = l
e.x = d
l.y = n
l.r = e
l.p = h
n.r = l
n.p = h
n.v = h
m.x = l
h.u = l
h.x = l
h.w = m
h.v = m
i.u = l
i.x = l
i.w = m
i.v = m
d.v = h
d.q = l
d.t = l
d.x = e
j.r = l
j.p = h
j.v = h
assert h.v.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: B = None
        self.t: B = None
        self.x: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: B = None
        self.w: D = None
        self.v: D = None
        self.txt = txt

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

e.v = h
e.q = l
e.t = l
e.x = d
l.y = n
l.r = e
l.p = h
n.r = l
n.p = h
n.v = h
m.x = l
h.u = l
h.x = l
h.w = m
h.v = m
i.u = l
i.x = l
i.w = m
i.v = m
d.v = h
d.q = l
d.t = l
d.x = e
j.r = l
j.p = h
j.v = h
assert h.v.x.p.txt == "h"