class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: B = None
        self.r: F = None
        self.o: B = None
        self.t: G = None
        self.s: G = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: D = None
        self.u: G = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: E = None
        self.r: F = None
        self.y: F = None
        self.p: B = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: F = None
        self.p: A = None
        self.v: F = None
        self.z: B = None
        self.o: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: D = None
        self.u: G = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: E = None
        self.r: F = None
        self.y: F = None
        self.p: B = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: F = None
        self.p: A = None
        self.v: F = None
        self.z: B = None
        self.o: E = None
        self.txt = txt

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

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