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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: G = None
        self.z: C = None
        self.r: F = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: G = None
        self.z: C = None
        self.r: F = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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