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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: D = None
        self.o: A = None
        self.q: C = None
        self.v: G = None
        self.txt = txt

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

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

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

d.v = k
d.o = m
g.o = h
g.y = i
g.w = i
a.r = j
j.o = i
j.z = m
k.t = d
k.o = d
k.x = j
k.q = a
k.v = h
n.y = f
h.v = n
h.w = n
h.x = i
f.r = j
i.o = h
i.y = g
i.w = g
m.t = d
m.o = d
m.x = j
m.q = f
m.v = h
assert k.v.x.w.o.w.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: D = None
        self.o: A = None
        self.q: C = None
        self.v: G = None
        self.txt = txt

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

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

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

d.v = k
d.o = m
g.o = h
g.y = i
g.w = i
a.r = j
j.o = i
j.z = m
k.t = d
k.o = d
k.x = j
k.q = a
k.v = h
n.y = f
h.v = n
h.w = n
h.x = i
f.r = j
i.o = h
i.y = g
i.w = g
m.t = d
m.o = d
m.x = j
m.q = f
m.v = h
assert k.v.x.w.o.w.y.r.txt == "j"