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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: F = None
        self.r: F = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: B = None
        self.w: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: F = None
        self.r: F = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: B = None
        self.w: G = None
        self.txt = txt

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

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

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

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