class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.w: C = None
        self.r: G = None
        self.v: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: A = None
        self.y: E = None
        self.p: C = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: B = None
        self.t: F = None
        self.r: C = None
        self.q: E = None
        self.v: C = None
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: A = None
        self.y: E = None
        self.p: C = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: B = None
        self.t: F = None
        self.r: C = None
        self.q: E = None
        self.v: C = None
        self.o: A = None
        self.txt = txt

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

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