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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.y: F = None
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: G = None
        self.z: B = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.y: F = None
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: G = None
        self.z: B = None
        self.q: D = None
        self.txt = txt

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

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

k.v = a
a.o = e
a.p = j
f.q = k
f.s = k
f.u = g
b.q = a
b.o = a
b.y = g
b.z = g
c.t = k
c.s = a
c.x = d
g.r = e
g.u = e
g.z = a
g.q = b
h.q = k
h.y = d
j.q = k
j.s = k
j.u = g
e.q = k
e.y = c
d.t = k
d.s = a
d.x = c
assert d.s.p.s.v.o.y.x.t.v.txt == "a"