class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: E = None
        self.v: G = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: H = None
        self.p: B = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

i = A("i")
m = B("m")
j = C("j")
e = D("e")
c = E("c")
n = F("n")
g = G("g")
f = H("f")

i.y = j
i.s = j
i.x = c
i.v = g
m.p = e
j.u = c
j.x = f
j.p = m
j.o = g
e.o = i
e.y = n
c.x = m
n.p = c
n.s = c
n.q = c
n.u = e
n.o = i
n.v = i
n.w = g
n.r = j
g.q = m
f.z = g
f.x = c
f.p = i
f.w = n
assert g.q.p.y.w.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: E = None
        self.v: G = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: H = None
        self.p: B = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

i = A("i")
m = B("m")
j = C("j")
e = D("e")
c = E("c")
n = F("n")
g = G("g")
f = H("f")

i.y = j
i.s = j
i.x = c
i.v = g
m.p = e
j.u = c
j.x = f
j.p = m
j.o = g
e.o = i
e.y = n
c.x = m
n.p = c
n.s = c
n.q = c
n.u = e
n.o = i
n.v = i
n.w = g
n.r = j
g.q = m
f.z = g
f.x = c
f.p = i
f.w = n
assert g.q.p.y.w.q.p.txt == "e"