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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: A = None
        self.r: A = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: F = None
        self.x: D = None
        self.o: A = None
        self.w: H = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.y: C = None
        self.o: D = None
        self.s: H = None
        self.r: B = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: E = None
        self.q: D = None
        self.x: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: A = None
        self.r: A = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: F = None
        self.x: D = None
        self.o: A = None
        self.w: H = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.y: C = None
        self.o: D = None
        self.s: H = None
        self.r: B = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: E = None
        self.q: D = None
        self.x: B = None
        self.txt = txt

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

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

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