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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: A = None
        self.v: A = None
        self.q: A = None
        self.r: E = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: A = None
        self.t: D = None
        self.o: A = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: C = None
        self.p: G = None
        self.v: A = None
        self.q: G = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: F = None
        self.q: B = None
        self.v: A = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: C = None
        self.r: C = None
        self.u: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: A = None
        self.v: A = None
        self.q: A = None
        self.r: E = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: A = None
        self.t: D = None
        self.o: A = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: C = None
        self.p: G = None
        self.v: A = None
        self.q: G = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: F = None
        self.q: B = None
        self.v: A = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: C = None
        self.r: C = None
        self.u: C = None
        self.txt = txt

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

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