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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: B = None
        self.v: D = None
        self.txt = txt

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

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

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

b = A("b")
g = B("g")
a = C("a")
e = D("e")
c = E("c")
f = F("f")
m = A("m")
l = E("l")
d = D("d")
i = D("i")

b.w = i
b.y = l
b.q = a
b.r = a
b.u = g
g.w = c
g.q = a
g.u = a
g.s = i
g.z = m
g.o = f
a.q = l
a.x = g
a.v = e
e.w = a
c.t = i
c.z = g
f.s = g
f.w = g
f.y = m
m.w = e
m.y = l
m.q = a
m.r = a
m.u = g
l.t = e
l.z = g
d.w = a
i.w = a
assert a.x.s.w.q.z.w.z.z.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: E = None
        self.q: C = None
        self.u: B = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: B = None
        self.v: D = None
        self.txt = txt

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

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

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

b = A("b")
g = B("g")
a = C("a")
e = D("e")
c = E("c")
f = F("f")
m = A("m")
l = E("l")
d = D("d")
i = D("i")

b.w = i
b.y = l
b.q = a
b.r = a
b.u = g
g.w = c
g.q = a
g.u = a
g.s = i
g.z = m
g.o = f
a.q = l
a.x = g
a.v = e
e.w = a
c.t = i
c.z = g
f.s = g
f.w = g
f.y = m
m.w = e
m.y = l
m.q = a
m.r = a
m.u = g
l.t = e
l.z = g
d.w = a
i.w = a
assert a.x.s.w.q.z.w.z.z.q.q.txt == "l"