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

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: B = None
        self.txt = txt

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

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

f = A("f")
c = B("c")
m = C("m")
l = D("l")
b = E("b")
g = A("g")
k = E("k")
a = C("a")

f.s = g
f.v = m
c.q = l
c.t = f
c.u = a
c.z = a
c.r = k
m.t = a
m.w = c
l.z = c
l.w = c
b.x = k
b.t = c
b.s = g
g.s = f
g.v = a
k.x = b
k.t = c
k.s = g
a.t = m
a.w = c
assert m.w.q.z.t.s.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: B = None
        self.txt = txt

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

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

f = A("f")
c = B("c")
m = C("m")
l = D("l")
b = E("b")
g = A("g")
k = E("k")
a = C("a")

f.s = g
f.v = m
c.q = l
c.t = f
c.u = a
c.z = a
c.r = k
m.t = a
m.w = c
l.z = c
l.w = c
b.x = k
b.t = c
b.s = g
g.s = f
g.v = a
k.x = b
k.t = c
k.s = g
a.t = m
a.w = c
assert m.w.q.z.t.s.s.v.txt == "m"