class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: F = None
        self.o: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: A = None
        self.o: D = None
        self.y: B = None
        self.q: D = None
        self.p: F = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: C = None
        self.t: A = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: C = None
        self.q: F = None
        self.t: C = None
        self.txt = txt

m = A("m")
b = B("b")
h = C("h")
j = D("j")
g = E("g")
a = F("a")
i = G("i")
d = B("d")

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: F = None
        self.o: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: A = None
        self.o: D = None
        self.y: B = None
        self.q: D = None
        self.p: F = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: C = None
        self.t: A = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: C = None
        self.q: F = None
        self.t: C = None
        self.txt = txt

m = A("m")
b = B("b")
h = C("h")
j = D("j")
g = E("g")
a = F("a")
i = G("i")
d = B("d")

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