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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: C = None
        self.s: E = None
        self.v: G = None
        self.txt = txt

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

g = A("g")
n = B("n")
f = C("f")
k = D("k")
e = E("e")
c = F("c")
h = G("h")
i = E("i")
j = D("j")
a = G("a")

g.v = n
g.r = n
g.q = e
n.p = g
n.z = c
f.p = j
f.x = n
k.r = n
k.s = i
k.u = f
e.v = j
e.s = g
c.o = f
c.p = f
c.s = e
c.v = h
h.r = j
i.v = k
i.s = g
j.r = n
j.s = e
j.u = f
a.r = j
assert e.v.s.s.q.s.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: E = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: C = None
        self.s: E = None
        self.v: G = None
        self.txt = txt

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

g = A("g")
n = B("n")
f = C("f")
k = D("k")
e = E("e")
c = F("c")
h = G("h")
i = E("i")
j = D("j")
a = G("a")

g.v = n
g.r = n
g.q = e
n.p = g
n.z = c
f.p = j
f.x = n
k.r = n
k.s = i
k.u = f
e.v = j
e.s = g
c.o = f
c.p = f
c.s = e
c.v = h
h.r = j
i.v = k
i.s = g
j.r = n
j.s = e
j.u = f
a.r = j
assert e.v.s.s.q.s.q.v.txt == "j"