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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: H = None
        self.w: G = None
        self.p: A = None
        self.q: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: G = None
        self.r: B = None
        self.o: E = None
        self.t: F = None
        self.x: F = None
        self.u: G = None
        self.z: E = None
        self.txt = txt

a = A("a")
m = B("m")
h = C("h")
j = D("j")
e = E("e")
f = F("f")
k = G("k")
g = H("g")
c = A("c")

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: H = None
        self.w: G = None
        self.p: A = None
        self.q: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: G = None
        self.r: B = None
        self.o: E = None
        self.t: F = None
        self.x: F = None
        self.u: G = None
        self.z: E = None
        self.txt = txt

a = A("a")
m = B("m")
h = C("h")
j = D("j")
e = E("e")
f = F("f")
k = G("k")
g = H("g")
c = A("c")

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