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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: D = None
        self.p: D = None
        self.x: B = None
        self.v: C = None
        self.z: A = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: C = None
        self.q: G = None
        self.x: B = None
        self.r: G = None
        self.u: B = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: D = None
        self.p: D = None
        self.x: B = None
        self.v: C = None
        self.z: A = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: C = None
        self.q: G = None
        self.x: B = None
        self.r: G = None
        self.u: B = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: A = None
        self.txt = txt

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

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