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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: A = None
        self.w: F = None
        self.t: D = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: D = None
        self.u: E = None
        self.q: B = None
        self.t: C = None
        self.txt = txt

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

k.u = g
a.v = l
a.u = k
a.w = i
a.x = i
a.t = f
l.s = b
l.r = b
l.w = i
l.v = g
l.t = g
l.y = f
l.x = k
f.u = g
f.t = i
g.s = b
i.w = g
i.q = f
b.z = a
b.q = a
b.s = f
b.u = g
b.t = l
assert k.u.s.u.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: A = None
        self.w: F = None
        self.t: D = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: D = None
        self.u: E = None
        self.q: B = None
        self.t: C = None
        self.txt = txt

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

k.u = g
a.v = l
a.u = k
a.w = i
a.x = i
a.t = f
l.s = b
l.r = b
l.w = i
l.v = g
l.t = g
l.y = f
l.x = k
f.u = g
f.t = i
g.s = b
i.w = g
i.q = f
b.z = a
b.q = a
b.s = f
b.u = g
b.t = l
assert k.u.s.u.s.q.txt == "a"