class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: F = None
        self.z: F = None
        self.p: D = None
        self.q: E = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: A = None
        self.o: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: E = None
        self.y: D = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: E = None
        self.y: B = None
        self.p: B = None
        self.txt = txt

k = A("k")
e = B("e")
n = C("n")
l = D("l")
j = E("j")
b = F("b")
i = G("i")
d = C("d")
m = A("m")
f = D("f")

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: A = None
        self.o: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: E = None
        self.y: D = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: E = None
        self.y: B = None
        self.p: B = None
        self.txt = txt

k = A("k")
e = B("e")
n = C("n")
l = D("l")
j = E("j")
b = F("b")
i = G("i")
d = C("d")
m = A("m")
f = D("f")

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