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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: H = None
        self.w: B = None
        self.x: E = None
        self.t: F = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: E = None
        self.t: C = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: C = None
        self.r: H = None
        self.s: B = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: H = None
        self.o: C = None
        self.txt = txt

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

m = A("m")
i = B("i")
k = C("k")
j = D("j")
a = E("a")
h = F("h")
d = G("d")
n = H("n")
c = C("c")

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: H = None
        self.w: B = None
        self.x: E = None
        self.t: F = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: E = None
        self.t: C = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: C = None
        self.r: H = None
        self.s: B = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: H = None
        self.o: C = None
        self.txt = txt

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

m = A("m")
i = B("i")
k = C("k")
j = D("j")
a = E("a")
h = F("h")
d = G("d")
n = H("n")
c = C("c")

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