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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: E = None
        self.x: H = None
        self.q: E = None
        self.s: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: A = None
        self.y: E = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: D = None
        self.z: C = None
        self.x: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: E = None
        self.x: H = None
        self.q: E = None
        self.s: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: A = None
        self.y: E = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: D = None
        self.z: C = None
        self.x: E = None
        self.txt = txt

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

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