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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.z: E = None
        self.o: B = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.z: E = None
        self.o: B = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

h.q = m
h.z = m
h.w = f
h.o = i
h.r = i
e.o = n
e.q = g
e.t = f
e.v = k
i.q = k
i.u = l
i.r = l
i.z = f
i.o = e
k.u = g
k.r = l
g.s = n
g.p = n
g.z = l
g.t = l
g.r = i
g.q = a
m.y = i
m.o = e
l.u = e
l.q = k
f.s = n
f.z = l
f.t = l
f.p = k
f.r = i
f.q = h
a.q = m
a.z = m
a.w = f
a.o = i
a.r = i
n.u = f
n.r = l
assert g.s.r.q.txt == "k"