class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: D = None
        self.u: C = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: G = None
        self.s: B = None
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: H = None
        self.v: H = None
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: E = None
        self.z: A = None
        self.w: I = None
        self.y: C = None
        self.s: E = None
        self.x: B = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: H = None
        self.x: A = None
        self.txt = txt

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

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

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

h.q = i
h.p = i
d.s = i
d.w = l
d.u = g
d.v = b
g.p = e
g.o = e
g.v = i
g.s = d
l.x = e
b.o = l
b.r = e
b.v = e
b.y = e
f.u = g
f.y = g
f.o = b
f.s = b
f.z = h
f.q = h
f.w = j
f.x = d
i.q = j
i.t = e
i.x = h
e.o = f
e.y = d
j.r = g
j.v = f
j.q = f
j.x = b
j.y = i
j.u = i
j.p = l
j.w = h
assert f.z.q.t.y.s.q.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: D = None
        self.u: C = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: G = None
        self.s: B = None
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: H = None
        self.v: H = None
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: E = None
        self.z: A = None
        self.w: I = None
        self.y: C = None
        self.s: E = None
        self.x: B = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: H = None
        self.x: A = None
        self.txt = txt

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

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

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

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