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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: D = None
        self.p: F = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: E = None
        self.w: B = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: D = None
        self.p: F = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: E = None
        self.w: B = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: E = None
        self.txt = txt

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

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

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