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

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: I = None
        self.z: A = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: E = None
        self.o: G = None
        self.v: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: C = None
        self.x: C = None
        self.w: D = None
        self.r: F = None
        self.q: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: I = None
        self.z: A = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: E = None
        self.o: G = None
        self.v: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: C = None
        self.x: C = None
        self.w: D = None
        self.r: F = None
        self.q: F = None
        self.txt = txt

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

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