class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

k = A("k")
d = B("d")
e = C("e")
m = D("m")
l = E("l")
a = F("a")
g = E("g")
n = B("n")
c = F("c")

k.q = d
k.o = e
d.w = c
e.t = m
e.z = m
e.x = k
m.x = n
m.q = g
m.w = k
m.u = k
l.x = k
l.w = k
l.u = g
a.u = m
a.s = m
g.x = k
g.w = k
g.u = l
n.w = c
c.u = m
c.s = m
assert e.x.q.w.s.u.o.x.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

k = A("k")
d = B("d")
e = C("e")
m = D("m")
l = E("l")
a = F("a")
g = E("g")
n = B("n")
c = F("c")

k.q = d
k.o = e
d.w = c
e.t = m
e.z = m
e.x = k
m.x = n
m.q = g
m.w = k
m.u = k
l.x = k
l.w = k
l.u = g
a.u = m
a.s = m
g.x = k
g.w = k
g.u = l
n.w = c
c.u = m
c.s = m
assert e.x.q.w.s.u.o.x.q.w.txt == "c"