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

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: I = None
        self.y: H = None
        self.z: A = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: H = None
        self.s: E = None
        self.r: D = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: G = None
        self.r: C = None
        self.q: C = None
        self.x: G = None
        self.o: G = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: I = None
        self.y: H = None
        self.z: A = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: H = None
        self.s: E = None
        self.r: D = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: G = None
        self.r: C = None
        self.q: C = None
        self.x: G = None
        self.o: G = None
        self.w: D = None
        self.txt = txt

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

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

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