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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: E = None
        self.u: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: G = None
        self.o: E = None
        self.y: B = None
        self.q: E = None
        self.u: F = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: E = None
        self.u: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: G = None
        self.o: E = None
        self.y: B = None
        self.q: E = None
        self.u: F = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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