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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: A = None
        self.y: H = None
        self.w: A = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: H = None
        self.p: A = None
        self.t: C = None
        self.q: C = None
        self.o: G = None
        self.w: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: A = None
        self.y: H = None
        self.w: A = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: H = None
        self.p: A = None
        self.t: C = None
        self.q: C = None
        self.o: G = None
        self.w: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: B = None
        self.txt = txt

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

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