class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: C = None
        self.q: E = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: F = None
        self.z: A = None
        self.p: H = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: B = None
        self.z: I = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: D = None
        self.u: C = None
        self.p: B = None
        self.o: D = None
        self.x: B = None
        self.z: F = None
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: I = None
        self.u: F = None
        self.v: I = None
        self.y: I = None
        self.t: F = None
        self.p: B = None
        self.x: G = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: C = None
        self.o: H = None
        self.w: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: F = None
        self.z: A = None
        self.p: H = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: B = None
        self.z: I = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: D = None
        self.u: C = None
        self.p: B = None
        self.o: D = None
        self.x: B = None
        self.z: F = None
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: I = None
        self.u: F = None
        self.v: I = None
        self.y: I = None
        self.t: F = None
        self.p: B = None
        self.x: G = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: C = None
        self.o: H = None
        self.w: E = None
        self.txt = txt

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

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