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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: E = None
        self.z: F = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: C = None
        self.s: A = None
        self.r: F = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: E = None
        self.z: F = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: C = None
        self.s: A = None
        self.r: F = None
        self.p: C = None
        self.txt = txt

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

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