class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: I = None
        self.y: E = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: G = None
        self.p: E = None
        self.w: H = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: I = None
        self.t: C = None
        self.y: C = None
        self.x: E = None
        self.u: F = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: H = None
        self.y: I = None
        self.x: B = None
        self.v: H = None
        self.p: G = None
        self.t: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: A = None
        self.t: A = None
        self.p: F = None
        self.u: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: G = None
        self.u: G = None
        self.v: G = None
        self.t: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: G = None
        self.p: E = None
        self.w: H = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: I = None
        self.t: C = None
        self.y: C = None
        self.x: E = None
        self.u: F = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: H = None
        self.y: I = None
        self.x: B = None
        self.v: H = None
        self.p: G = None
        self.t: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: A = None
        self.t: A = None
        self.p: F = None
        self.u: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: G = None
        self.u: G = None
        self.v: G = None
        self.t: C = None
        self.txt = txt

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

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