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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: E = None
        self.u: B = None
        self.r: A = None
        self.q: A = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

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

n.t = m
n.q = m
n.w = h
n.o = a
n.r = a
h.w = d
h.x = n
h.v = a
b.v = m
b.t = m
b.x = a
b.r = a
b.w = a
b.u = n
b.s = h
g.v = a
a.z = b
a.v = b
a.o = d
a.y = d
a.u = m
m.u = d
m.z = d
m.o = n
d.s = n
d.r = n
d.q = n
d.x = a
d.u = h
d.w = h
d.y = b
assert n.q.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: B = None
        self.o: E = None
        self.r: E = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: E = None
        self.u: B = None
        self.r: A = None
        self.q: A = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

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

n.t = m
n.q = m
n.w = h
n.o = a
n.r = a
h.w = d
h.x = n
h.v = a
b.v = m
b.t = m
b.x = a
b.r = a
b.w = a
b.u = n
b.s = h
g.v = a
a.z = b
a.v = b
a.o = d
a.y = d
a.u = m
m.u = d
m.z = d
m.o = n
d.s = n
d.r = n
d.q = n
d.x = a
d.u = h
d.w = h
d.y = b
assert n.q.u.u.txt == "h"