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

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

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

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

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

b = A("b")
i = B("i")
g = C("g")
f = D("f")
e = E("e")
a = D("a")
d = C("d")
k = B("k")

b.q = g
b.p = e
b.r = d
i.v = d
i.u = d
i.p = g
i.x = e
i.z = b
g.s = d
g.z = e
f.u = a
f.s = a
f.x = e
f.t = b
f.v = i
e.w = g
e.u = k
e.r = b
a.u = f
a.s = f
a.x = e
a.t = b
a.v = k
d.s = g
d.z = e
k.v = d
k.u = d
k.p = g
k.x = e
k.z = b
assert b.q.s.s.s.s.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: E = None
        self.r: C = None
        self.txt = txt

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

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

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

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

b = A("b")
i = B("i")
g = C("g")
f = D("f")
e = E("e")
a = D("a")
d = C("d")
k = B("k")

b.q = g
b.p = e
b.r = d
i.v = d
i.u = d
i.p = g
i.x = e
i.z = b
g.s = d
g.z = e
f.u = a
f.s = a
f.x = e
f.t = b
f.v = i
e.w = g
e.u = k
e.r = b
a.u = f
a.s = f
a.x = e
a.t = b
a.v = k
d.s = g
d.z = e
k.v = d
k.u = d
k.p = g
k.x = e
k.z = b
assert b.q.s.s.s.s.z.r.txt == "b"