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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.w: D = None
        self.z: B = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

b = A("b")
g = B("g")
d = C("d")
n = D("n")
j = E("j")
i = F("i")
f = G("f")
a = H("a")
k = E("k")
m = B("m")

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.w: D = None
        self.z: B = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

b = A("b")
g = B("g")
d = C("d")
n = D("n")
j = E("j")
i = F("i")
f = G("f")
a = H("a")
k = E("k")
m = B("m")

b.z = m
b.p = g
b.w = f
b.s = f
g.r = a
g.z = m
d.z = n
d.x = f
n.s = j
j.s = i
j.r = b
j.y = b
j.t = a
j.w = a
j.x = f
j.q = n
j.p = k
i.r = g
i.s = g
i.o = m
i.z = m
i.w = n
f.p = b
a.w = f
a.t = f
a.s = b
a.z = i
k.s = i
k.r = b
k.y = b
k.t = a
k.w = a
k.x = f
k.q = n
k.p = j
m.r = a
m.z = g
assert i.o.r.z.w.s.txt == "j"