class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: F = None
        self.o: H = None
        self.z: C = None
        self.p: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: G = None
        self.z: F = None
        self.s: H = None
        self.x: A = None
        self.t: H = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: C = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: E = None
        self.w: B = None
        self.u: D = None
        self.txt = txt

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

n = A("n")
l = B("l")
d = C("d")
g = D("g")
b = E("b")
f = F("f")
h = G("h")
k = H("k")

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: F = None
        self.o: H = None
        self.z: C = None
        self.p: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: G = None
        self.z: F = None
        self.s: H = None
        self.x: A = None
        self.t: H = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: C = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: E = None
        self.w: B = None
        self.u: D = None
        self.txt = txt

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

n = A("n")
l = B("l")
d = C("d")
g = D("g")
b = E("b")
f = F("f")
h = G("h")
k = H("k")

n.w = d
n.t = f
l.y = b
l.u = f
l.o = k
l.z = d
l.p = h
d.u = k
d.p = k
d.z = g
d.r = b
d.x = f
g.u = h
g.w = h
g.y = n
b.r = k
b.s = k
b.t = k
b.v = h
b.u = h
b.z = f
b.x = n
f.w = b
f.p = b
f.x = d
h.v = k
h.o = b
h.w = l
h.u = g
k.o = b
assert k.o.s.o.x.w.z.u.o.txt == "b"