class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: G = None
        self.v: H = None
        self.x: E = None
        self.w: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: H = None
        self.x: F = None
        self.z: A = None
        self.q: E = None
        self.v: E = None
        self.o: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: G = None
        self.v: D = None
        self.y: E = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: A = None
        self.q: A = None
        self.t: B = None
        self.u: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: H = None
        self.x: F = None
        self.z: A = None
        self.q: E = None
        self.v: E = None
        self.o: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: G = None
        self.v: D = None
        self.y: E = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: A = None
        self.q: A = None
        self.t: B = None
        self.u: G = None
        self.txt = txt

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

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