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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: A = None
        self.r: G = None
        self.q: C = None
        self.v: B = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: G = None
        self.w: F = None
        self.s: B = None
        self.o: D = None
        self.txt = txt

n = A("n")
e = B("e")
j = C("j")
k = D("k")
f = E("f")
c = F("c")
m = G("m")
g = H("g")

n.o = e
n.w = c
n.t = c
e.p = m
e.x = m
e.o = j
e.v = g
j.p = n
k.y = j
k.v = m
f.t = g
f.u = n
f.w = n
f.r = m
f.q = j
f.v = e
c.v = g
m.o = k
m.y = k
g.y = k
g.o = k
g.x = m
g.w = c
g.s = e
assert j.p.w.v.s.v.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: F = None
        self.t: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: A = None
        self.r: G = None
        self.q: C = None
        self.v: B = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: G = None
        self.w: F = None
        self.s: B = None
        self.o: D = None
        self.txt = txt

n = A("n")
e = B("e")
j = C("j")
k = D("k")
f = E("f")
c = F("c")
m = G("m")
g = H("g")

n.o = e
n.w = c
n.t = c
e.p = m
e.x = m
e.o = j
e.v = g
j.p = n
k.y = j
k.v = m
f.t = g
f.u = n
f.w = n
f.r = m
f.q = j
f.v = e
c.v = g
m.o = k
m.y = k
g.y = k
g.o = k
g.x = m
g.w = c
g.s = e
assert j.p.w.v.s.v.x.y.txt == "k"