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

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

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

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

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

j = A("j")
f = B("f")
m = C("m")
b = D("b")
d = E("d")
n = D("n")
a = C("a")
g = A("g")

j.s = g
j.x = d
j.u = n
j.q = f
f.u = d
f.r = d
f.y = d
f.w = g
m.z = j
m.u = f
m.p = b
m.w = d
b.x = m
b.t = m
d.u = m
n.x = m
n.t = m
a.z = j
a.u = f
a.p = n
a.w = d
g.s = j
g.x = d
g.u = b
g.q = f
assert f.u.u.u.w.u.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: E = None
        self.u: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

j = A("j")
f = B("f")
m = C("m")
b = D("b")
d = E("d")
n = D("n")
a = C("a")
g = A("g")

j.s = g
j.x = d
j.u = n
j.q = f
f.u = d
f.r = d
f.y = d
f.w = g
m.z = j
m.u = f
m.p = b
m.w = d
b.x = m
b.t = m
d.u = m
n.x = m
n.t = m
a.z = j
a.u = f
a.p = n
a.w = d
g.s = j
g.x = d
g.u = b
g.q = f
assert f.u.u.u.w.u.t.z.txt == "j"