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

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: A = None
        self.q: H = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: D = None
        self.q: E = None
        self.u: A = None
        self.t: H = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: C = None
        self.r: G = None
        self.o: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: A = None
        self.q: H = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: D = None
        self.q: E = None
        self.u: A = None
        self.t: H = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: C = None
        self.r: G = None
        self.o: E = None
        self.txt = txt

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

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