class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: G = None
        self.s: D = None
        self.t: G = None
        self.v: F = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: I = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: E = None
        self.q: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: A = None
        self.x: E = None
        self.z: H = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: I = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: E = None
        self.q: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: A = None
        self.x: E = None
        self.z: H = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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