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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: C = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: F = None
        self.o: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: C = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: F = None
        self.o: A = None
        self.p: B = None
        self.txt = txt

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

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