class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: H = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: E = None
        self.x: G = None
        self.r: I = None
        self.o: B = None
        self.p: E = None
        self.z: F = None
        self.q: D = None
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: D = None
        self.p: F = None
        self.r: E = None
        self.x: E = None
        self.t: A = None
        self.u: B = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: E = None
        self.o: G = None
        self.p: H = None
        self.s: D = None
        self.y: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: E = None
        self.x: G = None
        self.r: I = None
        self.o: B = None
        self.p: E = None
        self.z: F = None
        self.q: D = None
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: D = None
        self.p: F = None
        self.r: E = None
        self.x: E = None
        self.t: A = None
        self.u: B = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: E = None
        self.o: G = None
        self.p: H = None
        self.s: D = None
        self.y: B = None
        self.txt = txt

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

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