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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: D = None
        self.v: A = None
        self.z: A = None
        self.txt = txt

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

l = A("l")
f = B("f")
d = C("d")
m = D("m")
c = E("c")
a = A("a")
b = D("b")
h = E("h")
i = E("i")

l.p = c
l.v = a
l.u = f
f.y = b
f.q = a
f.r = h
d.z = f
d.x = i
m.s = f
m.p = b
m.v = l
m.z = l
c.s = d
c.q = f
a.p = i
a.v = l
a.u = f
b.s = f
b.p = m
b.v = l
b.z = l
h.s = d
h.q = f
i.s = d
i.q = f
assert b.p.s.q.v.p.q.r.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: A = None
        self.u: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: D = None
        self.v: A = None
        self.z: A = None
        self.txt = txt

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

l = A("l")
f = B("f")
d = C("d")
m = D("m")
c = E("c")
a = A("a")
b = D("b")
h = E("h")
i = E("i")

l.p = c
l.v = a
l.u = f
f.y = b
f.q = a
f.r = h
d.z = f
d.x = i
m.s = f
m.p = b
m.v = l
m.z = l
c.s = d
c.q = f
a.p = i
a.v = l
a.u = f
b.s = f
b.p = m
b.v = l
b.z = l
h.s = d
h.q = f
i.s = d
i.q = f
assert b.p.s.q.v.p.q.r.s.x.txt == "i"