class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: F = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: E = None
        self.p: A = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: C = None
        self.w: A = None
        self.s: B = None
        self.txt = txt

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

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

k = A("k")
c = B("c")
e = C("e")
g = D("g")
n = E("n")
a = F("a")
f = G("f")
j = F("j")
i = F("i")
h = G("h")

k.v = n
k.y = a
k.o = g
c.u = n
e.w = k
g.u = c
g.o = c
g.v = n
g.p = k
n.y = h
n.v = e
n.w = k
n.s = c
a.w = n
a.o = j
a.s = c
f.s = g
f.o = c
j.w = n
j.o = i
j.s = c
i.w = n
i.o = a
i.s = c
h.s = g
h.o = c
assert f.s.p.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: F = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: E = None
        self.p: A = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: C = None
        self.w: A = None
        self.s: B = None
        self.txt = txt

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

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

k = A("k")
c = B("c")
e = C("e")
g = D("g")
n = E("n")
a = F("a")
f = G("f")
j = F("j")
i = F("i")
h = G("h")

k.v = n
k.y = a
k.o = g
c.u = n
e.w = k
g.u = c
g.o = c
g.v = n
g.p = k
n.y = h
n.v = e
n.w = k
n.s = c
a.w = n
a.o = j
a.s = c
f.s = g
f.o = c
j.w = n
j.o = i
j.s = c
i.w = n
i.o = a
i.s = c
h.s = g
h.o = c
assert f.s.p.v.w.txt == "k"