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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: E = None
        self.o: E = None
        self.p: A = None
        self.v: D = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

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

c.z = f
e.x = l
d.t = l
d.p = l
d.w = e
d.r = k
d.x = k
d.v = c
d.u = a
k.p = f
k.w = l
a.z = e
a.x = d
a.s = c
l.q = f
l.v = f
l.w = a
l.r = a
l.o = d
l.y = c
l.u = k
f.r = e
f.w = a
f.o = a
f.u = a
f.p = c
f.v = k
f.z = l
assert d.u.x.v.z.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: E = None
        self.o: E = None
        self.p: A = None
        self.v: D = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

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

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