class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: E = None
        self.p: C = None
        self.o: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: F = None
        self.txt = txt

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

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