class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: H = None
        self.s: C = None
        self.r: H = None
        self.o: F = None
        self.w: F = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: E = None
        self.r: B = None
        self.v: A = None
        self.u: D = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: E = None
        self.r: B = None
        self.v: A = None
        self.u: D = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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