class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: D = None
        self.t: B = None
        self.y: D = None
        self.o: H = None
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: G = None
        self.x: B = None
        self.txt = txt

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

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

m = A("m")
n = B("n")
c = C("c")
b = D("b")
j = E("j")
h = F("h")
a = G("a")
e = H("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: G = None
        self.x: B = None
        self.txt = txt

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

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

m = A("m")
n = B("n")
c = C("c")
b = D("b")
j = E("j")
h = F("h")
a = G("a")
e = H("e")

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