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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: A = None
        self.y: D = None
        self.z: C = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: A = None
        self.q: H = None
        self.v: H = None
        self.w: B = None
        self.z: F = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: C = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: G = None
        self.t: F = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: A = None
        self.y: D = None
        self.z: C = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: A = None
        self.q: H = None
        self.v: H = None
        self.w: B = None
        self.z: F = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: C = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: G = None
        self.t: F = None
        self.w: B = None
        self.txt = txt

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

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