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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: B = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: B = None
        self.p: A = None
        self.t: D = None
        self.txt = txt

j = A("j")
g = B("g")
f = C("f")
h = D("h")
n = E("n")
l = F("l")
m = G("m")
c = B("c")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: B = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: B = None
        self.p: A = None
        self.t: D = None
        self.txt = txt

j = A("j")
g = B("g")
f = C("f")
h = D("h")
n = E("n")
l = F("l")
m = G("m")
c = B("c")

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