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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: D = None
        self.v: B = None
        self.w: E = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: D = None
        self.v: B = None
        self.w: E = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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