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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: G = None
        self.r: G = None
        self.x: F = None
        self.z: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: A = None
        self.y: C = None
        self.p: F = None
        self.o: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: G = None
        self.r: G = None
        self.x: F = None
        self.z: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: A = None
        self.y: C = None
        self.p: F = None
        self.o: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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