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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: B = None
        self.p: B = None
        self.y: A = None
        self.x: E = None
        self.t: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

m = A("m")
c = B("c")
b = C("b")
g = D("g")
f = E("f")
n = F("n")
i = G("i")
a = G("a")
k = A("k")

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: B = None
        self.p: B = None
        self.y: A = None
        self.x: E = None
        self.t: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

m = A("m")
c = B("c")
b = C("b")
g = D("g")
f = E("f")
n = F("n")
i = G("i")
a = G("a")
k = A("k")

m.u = f
m.o = f
m.y = f
m.q = n
m.z = n
m.w = i
c.s = f
c.t = f
c.y = n
c.v = b
c.q = m
c.z = i
c.r = g
b.v = m
b.y = m
b.o = c
b.p = c
b.x = f
b.t = i
g.x = c
f.o = b
f.w = c
f.z = c
f.u = m
n.t = f
n.r = g
i.p = c
a.p = c
k.u = f
k.o = f
k.y = f
k.q = n
k.z = n
k.w = a
assert g.x.t.w.q.q.txt == "n"