class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: B = None
        self.t: B = None
        self.w: G = None
        self.p: D = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: B = None
        self.x: H = None
        self.u: E = None
        self.r: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: A = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: C = None
        self.r: G = None
        self.txt = txt

a = A("a")
i = B("i")
f = C("f")
d = D("d")
k = E("k")
c = F("c")
e = G("e")
h = H("h")
l = D("l")
g = A("g")

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: B = None
        self.x: H = None
        self.u: E = None
        self.r: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: A = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: C = None
        self.r: G = None
        self.txt = txt

a = A("a")
i = B("i")
f = C("f")
d = D("d")
k = E("k")
c = F("c")
e = G("e")
h = H("h")
l = D("l")
g = A("g")

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