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

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

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

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

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

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

b.q = a
k.s = b
k.t = a
g.o = n
g.z = n
g.s = m
g.q = a
g.t = b
m.w = d
m.v = k
m.q = b
m.z = f
a.t = c
i.o = m
i.s = m
i.z = m
i.q = a
i.t = b
d.s = b
d.t = a
n.w = c
n.v = f
n.q = b
n.z = k
c.s = b
c.t = a
f.s = b
f.t = a
assert g.o.w.s.q.t.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

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

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

b.q = a
k.s = b
k.t = a
g.o = n
g.z = n
g.s = m
g.q = a
g.t = b
m.w = d
m.v = k
m.q = b
m.z = f
a.t = c
i.o = m
i.s = m
i.z = m
i.q = a
i.t = b
d.s = b
d.t = a
n.w = c
n.v = f
n.q = b
n.z = k
c.s = b
c.t = a
f.s = b
f.t = a
assert g.o.w.s.q.t.s.q.txt == "a"