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

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

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: B = None
        self.s: H = None
        self.q: B = None
        self.u: A = None
        self.y: E = None
        self.z: B = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: H = None
        self.y: G = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: B = None
        self.s: H = None
        self.q: B = None
        self.u: A = None
        self.y: E = None
        self.z: B = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: H = None
        self.y: G = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: G = None
        self.txt = txt

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

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