class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: A = None
        self.s: B = None
        self.o: B = None
        self.v: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: D = None
        self.z: D = None
        self.q: G = None
        self.x: A = None
        self.w: A = None
        self.txt = txt

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

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

j.s = c
j.q = m
g.z = m
g.x = m
g.q = l
f.y = c
f.z = j
f.s = g
f.o = g
f.v = n
n.p = k
m.q = c
m.v = j
h.v = g
h.s = n
h.z = n
h.q = b
h.x = j
h.w = j
c.o = f
c.x = n
c.q = l
c.s = g
l.y = b
l.z = j
l.s = g
l.o = g
l.v = n
k.v = g
k.s = n
k.z = n
k.q = b
k.x = j
k.w = j
b.o = f
b.x = n
b.q = l
b.s = g
assert k.x.q.q.x.p.v.q.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: A = None
        self.s: B = None
        self.o: B = None
        self.v: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: D = None
        self.z: D = None
        self.q: G = None
        self.x: A = None
        self.w: A = None
        self.txt = txt

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

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

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