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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: G = None
        self.v: E = None
        self.s: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: G = None
        self.v: E = None
        self.s: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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