class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: B = None
        self.p: C = None
        self.z: E = None
        self.t: F = 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.y: E = None
        self.o: G = None
        self.q: A = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: E = None
        self.txt = txt

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

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

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

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

n.x = l
n.p = l
n.w = d
n.z = g
n.t = j
m.v = g
l.y = g
l.o = f
l.q = n
l.p = e
e.q = n
e.z = g
g.s = j
g.p = m
g.w = l
g.o = e
g.v = e
g.r = f
j.s = m
f.t = l
d.v = g
assert e.z.w.o.t.y.o.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: B = None
        self.p: C = None
        self.z: E = None
        self.t: F = 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.y: E = None
        self.o: G = None
        self.q: A = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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