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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: F = None
        self.s: H = None
        self.o: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: E = None
        self.x: D = None
        self.v: H = None
        self.z: H = None
        self.q: D = None
        self.w: H = None
        self.u: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: F = None
        self.s: H = None
        self.o: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: E = None
        self.x: D = None
        self.v: H = None
        self.z: H = None
        self.q: D = None
        self.w: H = None
        self.u: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: G = None
        self.txt = txt

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

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