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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: C = None
        self.v: A = None
        self.q: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: E = None
        self.o: B = None
        self.w: D = None
        self.v: D = None
        self.txt = txt

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

h = A("h")
g = B("g")
l = C("l")
m = D("m")
b = E("b")
k = F("k")
e = G("e")

h.p = g
h.s = b
h.y = k
h.o = k
h.q = l
h.x = e
g.y = l
g.x = l
g.q = l
g.v = h
l.v = e
l.w = h
l.t = h
l.p = k
l.q = k
l.x = b
l.u = m
m.y = k
b.x = l
b.w = g
b.v = e
k.x = g
k.o = g
k.p = b
k.w = m
k.v = m
e.o = g
e.x = b
assert g.v.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: E = None
        self.y: F = None
        self.q: C = None
        self.x: G = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: C = None
        self.v: A = None
        self.q: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: E = None
        self.o: B = None
        self.w: D = None
        self.v: D = None
        self.txt = txt

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

h = A("h")
g = B("g")
l = C("l")
m = D("m")
b = E("b")
k = F("k")
e = G("e")

h.p = g
h.s = b
h.y = k
h.o = k
h.q = l
h.x = e
g.y = l
g.x = l
g.q = l
g.v = h
l.v = e
l.w = h
l.t = h
l.p = k
l.q = k
l.x = b
l.u = m
m.y = k
b.x = l
b.w = g
b.v = e
k.x = g
k.o = g
k.p = b
k.w = m
k.v = m
e.o = g
e.x = b
assert g.v.q.v.txt == "e"