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

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: G = None
        self.p: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: B = None
        self.p: I = None
        self.u: A = None
        self.y: B = None
        self.r: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: B = None
        self.x: C = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: E = None
        self.y: B = None
        self.q: B = None
        self.p: E = None
        self.v: A = None
        self.s: B = None
        self.z: B = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: I = None
        self.z: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: G = None
        self.p: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: B = None
        self.p: I = None
        self.u: A = None
        self.y: B = None
        self.r: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: B = None
        self.x: C = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: E = None
        self.y: B = None
        self.q: B = None
        self.p: E = None
        self.v: A = None
        self.s: B = None
        self.z: B = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: I = None
        self.z: F = None
        self.txt = txt

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

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

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