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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: C = None
        self.u: F = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: F = None
        self.r: G = None
        self.q: G = None
        self.p: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: A = None
        self.txt = txt

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

n = A("n")
b = B("b")
h = C("h")
c = D("c")
j = E("j")
k = F("k")
m = G("m")
a = C("a")
l = E("l")
g = C("g")

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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: C = None
        self.u: F = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: F = None
        self.r: G = None
        self.q: G = None
        self.p: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: A = None
        self.txt = txt

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

n = A("n")
b = B("b")
h = C("h")
c = D("c")
j = E("j")
k = F("k")
m = G("m")
a = C("a")
l = E("l")
g = C("g")

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