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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.p: E = None
        self.s: C = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.p: E = None
        self.s: C = None
        self.u: E = None
        self.txt = txt

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

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

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

g.w = a
g.p = a
g.q = a
g.x = n
g.s = k
k.u = a
k.o = l
k.s = n
n.x = g
i.r = n
i.z = n
i.s = n
i.p = e
i.u = e
e.q = n
e.u = i
m.r = l
m.w = l
m.u = n
m.z = k
m.o = g
m.p = e
b.r = n
b.z = n
b.s = n
b.p = e
b.u = e
l.r = m
l.w = m
l.u = n
l.z = k
l.o = a
l.p = e
a.w = g
a.p = g
a.q = g
a.x = n
a.s = k
assert b.u.q.x.txt == "g"