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

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

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

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

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

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

e.u = b
j.x = k
n.q = e
n.p = f
n.v = k
g.r = e
g.u = e
d.v = e
d.s = c
d.p = j
l.q = e
l.p = b
l.v = k
c.r = e
c.u = e
f.q = e
f.p = b
f.v = k
b.q = e
b.p = n
b.v = k
k.v = e
k.s = c
k.p = j
assert l.q.u.v.p.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

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

e.u = b
j.x = k
n.q = e
n.p = f
n.v = k
g.r = e
g.u = e
d.v = e
d.s = c
d.p = j
l.q = e
l.p = b
l.v = k
c.r = e
c.u = e
f.q = e
f.p = b
f.v = k
b.q = e
b.p = n
b.v = k
k.v = e
k.s = c
k.p = j
assert l.q.u.v.p.x.s.txt == "c"