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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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