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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: G = None
        self.r: F = None
        self.y: B = None
        self.x: A = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: E = None
        self.y: C = None
        self.o: H = None
        self.z: E = None
        self.s: E = None
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: E = None
        self.p: D = None
        self.v: F = None
        self.u: D = None
        self.s: C = None
        self.txt = txt

f = A("f")
l = B("l")
c = C("c")
k = D("k")
i = E("i")
m = F("m")
e = G("e")
h = H("h")
b = D("b")
g = E("g")

f.q = k
f.o = c
f.z = c
f.w = g
l.y = m
l.u = m
l.q = b
c.q = h
c.o = e
c.r = m
c.y = l
c.x = f
c.p = g
k.v = i
k.z = i
k.u = g
k.s = g
k.y = c
k.o = h
k.x = f
i.z = h
i.r = m
i.w = g
i.q = f
i.o = e
m.r = i
m.t = e
e.y = k
e.x = l
h.o = c
h.s = c
h.x = i
h.p = k
h.v = m
h.u = b
b.v = i
b.u = i
b.z = i
b.y = c
b.o = h
b.s = g
b.x = f
g.z = h
g.r = m
g.w = i
g.q = f
g.o = e
assert g.w.q.q.v.o.x.u.r.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: C = None
        self.w: E = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: G = None
        self.r: F = None
        self.y: B = None
        self.x: A = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: E = None
        self.y: C = None
        self.o: H = None
        self.z: E = None
        self.s: E = None
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: E = None
        self.p: D = None
        self.v: F = None
        self.u: D = None
        self.s: C = None
        self.txt = txt

f = A("f")
l = B("l")
c = C("c")
k = D("k")
i = E("i")
m = F("m")
e = G("e")
h = H("h")
b = D("b")
g = E("g")

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