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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: F = None
        self.x: A = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: G = None
        self.x: A = None
        self.w: C = None
        self.o: A = None
        self.z: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: F = None
        self.x: A = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: G = None
        self.x: A = None
        self.w: C = None
        self.o: A = None
        self.z: C = None
        self.txt = txt

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

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

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