class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: B = None
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: A = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: A = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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