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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: F = None
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: I = None
        self.y: I = None
        self.r: B = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: B = None
        self.r: C = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: D = None
        self.t: I = None
        self.p: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: F = None
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: I = None
        self.y: I = None
        self.r: B = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: B = None
        self.r: C = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: D = None
        self.t: I = None
        self.p: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: F = None
        self.txt = txt

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

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

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