class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: F = None
        self.q: C = None
        self.x: D = None
        self.w: C = None
        self.s: B = None
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: E = None
        self.w: D = None
        self.q: H = None
        self.o: H = None
        self.t: C = None
        self.x: H = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: F = None
        self.q: G = None
        self.s: D = None
        self.p: F = None
        self.w: F = None
        self.z: B = None
        self.x: G = None
        self.txt = txt

a = A("a")
c = B("c")
k = C("k")
e = D("e")
g = E("g")
h = F("h")
m = G("m")
d = H("d")
b = E("b")
n = B("n")

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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: E = None
        self.w: D = None
        self.q: H = None
        self.o: H = None
        self.t: C = None
        self.x: H = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: F = None
        self.q: G = None
        self.s: D = None
        self.p: F = None
        self.w: F = None
        self.z: B = None
        self.x: G = None
        self.txt = txt

a = A("a")
c = B("c")
k = C("k")
e = D("e")
g = E("g")
h = F("h")
m = G("m")
d = H("d")
b = E("b")
n = B("n")

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