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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: B = None
        self.w: B = None
        self.v: F = None
        self.q: B = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: F = None
        self.p: D = None
        self.u: D = None
        self.q: D = None
        self.o: F = None
        self.txt = txt

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

l = A("l")
g = B("g")
k = C("k")
f = D("f")
i = E("i")
m = F("m")
c = D("c")

l.q = g
l.y = i
g.r = k
g.x = k
g.q = l
g.s = i
k.r = l
k.p = l
k.u = f
k.x = i
k.w = m
k.s = g
f.u = g
f.y = g
f.w = g
f.q = g
f.r = g
f.v = m
i.r = g
i.z = m
i.o = m
i.p = f
i.q = f
i.u = c
m.w = k
c.u = g
c.y = g
c.w = g
c.q = g
c.r = g
c.v = m
assert c.v.w.w.w.u.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: B = None
        self.w: B = None
        self.v: F = None
        self.q: B = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: F = None
        self.p: D = None
        self.u: D = None
        self.q: D = None
        self.o: F = None
        self.txt = txt

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

l = A("l")
g = B("g")
k = C("k")
f = D("f")
i = E("i")
m = F("m")
c = D("c")

l.q = g
l.y = i
g.r = k
g.x = k
g.q = l
g.s = i
k.r = l
k.p = l
k.u = f
k.x = i
k.w = m
k.s = g
f.u = g
f.y = g
f.w = g
f.q = g
f.r = g
f.v = m
i.r = g
i.z = m
i.o = m
i.p = f
i.q = f
i.u = c
m.w = k
c.u = g
c.y = g
c.w = g
c.q = g
c.r = g
c.v = m
assert c.v.w.w.w.u.q.s.txt == "i"