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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: H = None
        self.w: A = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: F = None
        self.v: B = None
        self.y: C = None
        self.w: B = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: H = None
        self.s: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: D = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: H = None
        self.w: A = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: F = None
        self.v: B = None
        self.y: C = None
        self.w: B = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: H = None
        self.s: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: D = None
        self.q: C = None
        self.txt = txt

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

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

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