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

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

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

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

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

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

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

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

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

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

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

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

g.p = m
g.x = f
f.r = g
f.y = g
f.z = g
f.u = k
f.p = i
m.s = g
m.o = g
m.p = f
m.q = f
l.z = f
l.v = m
h.s = b
h.y = m
h.u = g
h.x = f
h.t = i
b.z = f
b.v = m
n.z = f
n.v = m
i.s = d
i.y = m
i.u = g
i.x = f
i.t = h
d.z = f
d.v = m
k.s = d
k.y = m
k.u = g
k.x = f
k.t = i
assert l.v.q.p.y.o.p.o.p.s.x.txt == "f"