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

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

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

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

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

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

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

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

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

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

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

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

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

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

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