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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: H = None
        self.r: A = None
        self.u: D = None
        self.o: G = None
        self.s: I = None
        self.v: E = None
        self.q: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.t: C = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: D = None
        self.z: A = None
        self.p: B = None
        self.w: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.p: A = None
        self.u: H = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: H = None
        self.r: A = None
        self.u: D = None
        self.o: G = None
        self.s: I = None
        self.v: E = None
        self.q: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.t: C = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: D = None
        self.z: A = None
        self.p: B = None
        self.w: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.p: A = None
        self.u: H = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

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

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