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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: H = None
        self.x: F = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: E = None
        self.txt = txt

a = A("a")
g = B("g")
f = C("f")
m = D("m")
k = E("k")
h = F("h")
n = G("n")
i = H("i")
b = B("b")
j = G("j")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: H = None
        self.x: F = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: E = None
        self.txt = txt

a = A("a")
g = B("g")
f = C("f")
m = D("m")
k = E("k")
h = F("h")
n = G("n")
i = H("i")
b = B("b")
j = G("j")

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