class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: D = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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