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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: F = None
        self.y: H = None
        self.r: B = None
        self.z: D = None
        self.u: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: F = None
        self.y: H = None
        self.r: B = None
        self.z: D = None
        self.u: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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