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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: E = None
        self.q: G = None
        self.s: D = None
        self.u: I = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: F = None
        self.u: H = None
        self.y: E = None
        self.p: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: A = None
        self.x: C = None
        self.u: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.v: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: E = None
        self.q: G = None
        self.s: D = None
        self.u: I = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: F = None
        self.u: H = None
        self.y: E = None
        self.p: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: A = None
        self.x: C = None
        self.u: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.v: A = None
        self.txt = txt

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

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