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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: H = None
        self.x: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.z: C = None
        self.p: B = None
        self.x: B = None
        self.q: F = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: H = None
        self.x: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.z: C = None
        self.p: B = None
        self.x: B = None
        self.q: F = None
        self.o: B = None
        self.txt = txt

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

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