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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: D = None
        self.t: E = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: A = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: A = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: G = None
        self.y: B = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: D = None
        self.t: E = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: A = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: A = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: G = None
        self.y: B = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: C = None
        self.txt = txt

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

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

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