class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: G = None
        self.t: H = None
        self.s: C = None
        self.y: E = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: A = None
        self.q: A = None
        self.p: E = None
        self.x: G = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: D = None
        self.o: B = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: B = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: A = None
        self.y: F = None
        self.z: H = None
        self.w: A = None
        self.p: H = None
        self.s: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: F = None
        self.r: D = None
        self.o: D = None
        self.t: D = None
        self.z: E = None
        self.v: E = None
        self.txt = txt

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

d = A("d")
i = B("i")
c = C("c")
b = D("b")
h = E("h")
k = F("k")
j = G("j")
f = H("f")
g = H("g")
e = D("e")

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: A = None
        self.q: A = None
        self.p: E = None
        self.x: G = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: D = None
        self.o: B = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: B = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: A = None
        self.y: F = None
        self.z: H = None
        self.w: A = None
        self.p: H = None
        self.s: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: F = None
        self.r: D = None
        self.o: D = None
        self.t: D = None
        self.z: E = None
        self.v: E = None
        self.txt = txt

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

d = A("d")
i = B("i")
c = C("c")
b = D("b")
h = E("h")
k = F("k")
j = G("j")
f = H("f")
g = H("g")
e = D("e")

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