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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: E = None
        self.r: F = None
        self.v: H = None
        self.q: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: D = None
        self.r: E = None
        self.p: B = None
        self.q: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: H = None
        self.s: F = None
        self.w: C = None
        self.q: A = None
        self.t: B = None
        self.r: A = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: E = None
        self.r: F = None
        self.v: H = None
        self.q: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: D = None
        self.r: E = None
        self.p: B = None
        self.q: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: H = None
        self.s: F = None
        self.w: C = None
        self.q: A = None
        self.t: B = None
        self.r: A = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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