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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: C = None
        self.q: F = None
        self.p: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: I = None
        self.p: F = None
        self.v: I = None
        self.r: C = None
        self.z: I = None
        self.w: I = None
        self.t: I = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: E = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: I = None
        self.u: G = None
        self.t: I = None
        self.q: F = None
        self.x: B = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: C = None
        self.x: B = None
        self.q: A = None
        self.y: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: C = None
        self.q: F = None
        self.p: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: I = None
        self.p: F = None
        self.v: I = None
        self.r: C = None
        self.z: I = None
        self.w: I = None
        self.t: I = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: E = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: I = None
        self.u: G = None
        self.t: I = None
        self.q: F = None
        self.x: B = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: C = None
        self.x: B = None
        self.q: A = None
        self.y: C = None
        self.txt = txt

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

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