class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: G = None
        self.t: F = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: A = None
        self.w: A = None
        self.p: A = None
        self.o: G = None
        self.z: A = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

n.o = j
n.z = j
n.p = d
n.t = a
f.s = d
f.o = d
f.x = n
f.w = n
f.p = n
f.z = n
f.v = e
j.v = f
l.v = a
l.s = a
l.o = n
e.p = n
e.r = n
e.q = f
e.w = f
e.s = d
e.y = a
e.o = a
a.o = e
a.q = e
a.s = f
a.r = f
a.p = j
d.o = n
d.v = e
assert e.w.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: G = None
        self.t: F = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: A = None
        self.w: A = None
        self.p: A = None
        self.o: G = None
        self.z: A = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

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