class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: C = None
        self.s: A = None
        self.t: E = None
        self.v: A = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: E = None
        self.t: F = None
        self.r: F = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: F = None
        self.v: A = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: D = None
        self.o: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: E = None
        self.t: F = None
        self.r: F = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: F = None
        self.v: A = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: D = None
        self.o: A = None
        self.txt = txt

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

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