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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: A = None
        self.w: E = None
        self.r: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: A = None
        self.w: E = None
        self.r: A = None
        self.v: A = None
        self.txt = txt

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

d.t = i
d.x = f
n.t = f
n.x = b
k.u = f
k.z = d
f.s = b
m.t = f
m.p = b
m.w = g
m.r = d
m.v = d
c.s = b
g.t = f
g.p = d
g.r = d
g.w = m
g.v = b
i.u = f
i.z = d
b.t = k
b.x = c
assert c.s.t.u.s.x.s.txt == "b"