class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: C = None
        self.z: D = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: F = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: F = None
        self.q: C = None
        self.z: G = None
        self.w: E = None
        self.txt = txt

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

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

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

h = A("h")
b = B("b")
n = C("n")
l = D("l")
j = E("j")
a = F("a")
g = G("g")

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: F = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: F = None
        self.q: C = None
        self.z: G = None
        self.w: E = None
        self.txt = txt

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

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

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

h = A("h")
b = B("b")
n = C("n")
l = D("l")
j = E("j")
a = F("a")
g = G("g")

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