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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: F = None
        self.p: C = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: D = None
        self.t: D = None
        self.x: C = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: B = None
        self.p: D = None
        self.u: C = None
        self.y: A = None
        self.o: A = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: F = None
        self.p: C = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: D = None
        self.t: D = None
        self.x: C = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: B = None
        self.p: D = None
        self.u: C = None
        self.y: A = None
        self.o: A = None
        self.z: E = None
        self.txt = txt

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

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

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