class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: A = None
        self.r: E = None
        self.u: A = None
        self.t: E = None
        self.y: A = None
        self.z: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: F = None
        self.w: A = None
        self.y: F = None
        self.o: C = None
        self.r: F = None
        self.txt = txt

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

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

l = A("l")
i = B("i")
k = C("k")
h = D("h")
n = E("n")
f = F("f")
g = G("g")
m = G("m")

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: A = None
        self.r: E = None
        self.u: A = None
        self.t: E = None
        self.y: A = None
        self.z: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: F = None
        self.w: A = None
        self.y: F = None
        self.o: C = None
        self.r: F = None
        self.txt = txt

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

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

l = A("l")
i = B("i")
k = C("k")
h = D("h")
n = E("n")
f = F("f")
g = G("g")
m = G("m")

l.z = h
i.x = h
i.v = l
i.u = l
i.y = l
i.r = n
i.t = n
i.z = f
k.v = g
k.w = f
k.o = f
k.u = n
k.x = l
h.q = f
h.z = i
n.u = g
n.p = f
n.y = f
n.r = f
n.w = l
n.o = k
f.w = k
f.t = k
f.v = h
g.q = l
g.o = l
g.x = f
g.w = n
g.t = n
g.y = h
m.q = l
m.o = l
m.x = f
m.w = n
m.t = n
m.y = h
assert i.r.r.v.q.txt == "f"