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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: E = None
        self.y: G = None
        self.p: A = None
        self.t: B = None
        self.z: B = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: H = None
        self.v: C = None
        self.r: F = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: G = None
        self.z: A = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: F = None
        self.o: H = None
        self.r: F = None
        self.w: E = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: G = None
        self.p: D = None
        self.txt = txt

c = A("c")
j = B("j")
k = C("k")
n = D("n")
i = E("i")
l = F("l")
g = G("g")
b = H("b")
f = G("f")

c.y = k
j.w = i
j.z = i
j.s = k
j.y = n
j.r = b
k.u = c
k.p = c
k.s = i
k.y = g
k.t = j
k.z = j
k.r = j
n.z = j
n.q = c
n.w = k
i.w = n
i.p = b
i.v = k
i.r = l
i.z = c
l.v = g
l.q = g
l.z = c
l.s = f
g.t = b
g.o = b
g.z = l
g.r = l
g.w = i
g.x = n
b.o = l
b.y = f
b.p = n
f.t = b
f.o = b
f.z = l
f.r = l
f.w = i
f.x = n
assert b.y.w.w.w.y.w.p.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: E = None
        self.y: G = None
        self.p: A = None
        self.t: B = None
        self.z: B = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: H = None
        self.v: C = None
        self.r: F = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: G = None
        self.z: A = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: F = None
        self.o: H = None
        self.r: F = None
        self.w: E = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: G = None
        self.p: D = None
        self.txt = txt

c = A("c")
j = B("j")
k = C("k")
n = D("n")
i = E("i")
l = F("l")
g = G("g")
b = H("b")
f = G("f")

c.y = k
j.w = i
j.z = i
j.s = k
j.y = n
j.r = b
k.u = c
k.p = c
k.s = i
k.y = g
k.t = j
k.z = j
k.r = j
n.z = j
n.q = c
n.w = k
i.w = n
i.p = b
i.v = k
i.r = l
i.z = c
l.v = g
l.q = g
l.z = c
l.s = f
g.t = b
g.o = b
g.z = l
g.r = l
g.w = i
g.x = n
b.o = l
b.y = f
b.p = n
f.t = b
f.o = b
f.z = l
f.r = l
f.w = i
f.x = n
assert b.y.w.w.w.y.w.p.p.z.txt == "j"