class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: H = None
        self.u: E = None
        self.p: I = None
        self.x: H = None
        self.w: E = None
        self.v: E = None
        self.s: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: C = None
        self.v: I = None
        self.p: F = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: C = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: C = None
        self.o: F = None
        self.w: F = None
        self.x: H = None
        self.txt = txt

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

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

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

a.o = j
a.t = b
a.x = b
a.s = b
a.u = g
a.w = g
a.v = g
a.p = d
j.q = i
j.p = h
j.s = a
i.p = h
i.u = j
f.z = g
g.q = a
g.o = i
g.v = d
g.p = h
g.r = n
h.v = l
h.o = i
h.q = a
l.p = n
l.r = i
l.o = h
l.w = h
l.x = b
b.v = h
d.v = i
d.o = h
d.s = b
d.w = g
d.x = l
n.z = g
assert f.z.p.q.o.q.p.q.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: H = None
        self.u: E = None
        self.p: I = None
        self.x: H = None
        self.w: E = None
        self.v: E = None
        self.s: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: C = None
        self.v: I = None
        self.p: F = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: C = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: C = None
        self.o: F = None
        self.w: F = None
        self.x: H = None
        self.txt = txt

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

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

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

a.o = j
a.t = b
a.x = b
a.s = b
a.u = g
a.w = g
a.v = g
a.p = d
j.q = i
j.p = h
j.s = a
i.p = h
i.u = j
f.z = g
g.q = a
g.o = i
g.v = d
g.p = h
g.r = n
h.v = l
h.o = i
h.q = a
l.p = n
l.r = i
l.o = h
l.w = h
l.x = b
b.v = h
d.v = i
d.o = h
d.s = b
d.w = g
d.x = l
n.z = g
assert f.z.p.q.o.q.p.q.p.w.txt == "g"