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

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

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

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

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

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

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

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

f.w = e
f.u = n
f.v = l
n.q = l
n.t = b
k.p = l
k.o = a
k.q = a
e.x = a
e.s = a
e.y = f
e.v = b
l.o = b
l.u = a
l.v = a
l.s = n
l.q = k
a.p = f
a.x = l
a.y = e
a.q = k
b.w = a
b.q = k
b.r = e
b.x = e
b.s = l
assert f.w.y.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: B = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

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

f.w = e
f.u = n
f.v = l
n.q = l
n.t = b
k.p = l
k.o = a
k.q = a
e.x = a
e.s = a
e.y = f
e.v = b
l.o = b
l.u = a
l.v = a
l.s = n
l.q = k
a.p = f
a.x = l
a.y = e
a.q = k
b.w = a
b.q = k
b.r = e
b.x = e
b.s = l
assert f.w.y.w.v.txt == "b"