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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: D = None
        self.v: B = None
        self.y: E = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: G = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: B = None
        self.w: E = None
        self.v: B = None
        self.txt = txt

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

d.v = k
d.o = h
d.s = i
j.x = k
i.s = h
i.o = h
i.v = j
i.y = k
i.p = k
h.s = c
h.r = n
h.z = j
h.w = k
k.q = n
n.y = j
n.p = j
n.w = c
c.r = d
c.z = j
c.v = j
c.w = k
f.s = h
f.o = h
f.v = j
f.y = k
f.p = k
assert n.p.x.q.w.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: D = None
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: D = None
        self.v: B = None
        self.y: E = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: G = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: B = None
        self.w: E = None
        self.v: B = None
        self.txt = txt

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

d.v = k
d.o = h
d.s = i
j.x = k
i.s = h
i.o = h
i.v = j
i.y = k
i.p = k
h.s = c
h.r = n
h.z = j
h.w = k
k.q = n
n.y = j
n.p = j
n.w = c
c.r = d
c.z = j
c.v = j
c.w = k
f.s = h
f.o = h
f.v = j
f.y = k
f.p = k
assert n.p.x.q.w.z.x.txt == "k"