class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: D = None
        self.y: I = None
        self.v: I = None
        self.q: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: E = None
        self.y: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: G = None
        self.s: I = None
        self.x: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: F = None
        self.r: F = None
        self.x: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: E = None
        self.y: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: G = None
        self.s: I = None
        self.x: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: F = None
        self.r: F = None
        self.x: H = None
        self.txt = txt

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

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